package cn.xshi.bpm.service.impl;
import java.util.List;
import java.util.Map;
import cn.xshi.common.base.BaseService;
import cn.xshi.common.util.ExceptionUtil;
import org.springframework.stereotype.Service;
import cn.xshi.bpm.service.LcNodeFormFieldService;
import cn.xshi.bpm.dao.LcNodeFormFieldDao;
import cn.xshi.bpm.model.LcNodeFormField;
import javax.annotation.Resource;
/**
* @Desc 节点字段 
* @Author 邓纯杰
* @CreateTime 2022-04-06 11:41:43
*/
@Service
public class LcNodeFormFieldServiceImpl extends BaseService implements LcNodeFormFieldService{

	@Resource
	private LcNodeFormFieldDao lcNodeFormFieldDao;

	/**
	* 分页
	* @param condition 
	* @return
	*/
	public List<LcNodeFormField> getLcNodeFormFieldListByCondition(Map<String,Object> condition){
		try{
			return lcNodeFormFieldDao.getLcNodeFormFieldListByCondition(condition);
		} catch (Exception e) {
			throw new ExceptionUtil(e.getMessage(),e.getCause());
		}
	}
	/**
	* 查询对象
	* @param id
	* @return
	*/
	public LcNodeFormField getLcNodeFormFieldById(String id){
		try{
			LcNodeFormField lcNodeFormField = lcNodeFormFieldDao.getLcNodeFormFieldById(id);
			return lcNodeFormField;
		} catch (Exception e) {
			throw new ExceptionUtil(e.getMessage(),e.getCause());
		}
	}

	/**
	* 添加
	* @param lcNodeFormField 
	* @return
	*/
	public int addLcNodeFormField(LcNodeFormField lcNodeFormField){
		int i = 0;
		try {
			lcNodeFormField.setCreateId(getCurrentAccountId());
			lcNodeFormField.setCreateTime(getDate());
			lcNodeFormField.setId(toUUID());
			i = lcNodeFormFieldDao.addLcNodeFormField(lcNodeFormField);
		} catch (Exception e) {
			throw new ExceptionUtil(e.getMessage(),e.getCause());
		}
		return i;
	}

	/**
	* 修改
	* @param lcNodeFormField 
	* @return
	*/
	public int updateLcNodeFormField(LcNodeFormField lcNodeFormField){
		int i = 0;
		try {
			lcNodeFormField.setUpdateId(getCurrentAccountId());
			lcNodeFormField.setUpdateTime(getDate());
			i = lcNodeFormFieldDao.updateLcNodeFormField(lcNodeFormField);
		} catch (Exception e) {
			throw new ExceptionUtil(e.getMessage(),e.getCause());
		}
		return i;
	}

	/**
	* 修改（根据动态条件）
	* @param lcNodeFormField 
	* @return
	*/
	public int updateLcNodeFormFieldBySelective(LcNodeFormField lcNodeFormField){
		int i = 0;
		try {
			lcNodeFormField.setUpdateId(getCurrentAccountId());
			lcNodeFormField.setUpdateTime(getDate());
			i = lcNodeFormFieldDao.updateLcNodeFormFieldBySelective(lcNodeFormField);
		} catch (Exception e) {
			throw new ExceptionUtil(e.getMessage(),e.getCause());
		}
		return i;
	}

	/**
	* 删除
	* @param condition 
	* @return
	*/
	public int delLcNodeFormField(Map<String,Object> condition){
		int i = 0;
		try {
			i = lcNodeFormFieldDao.delLcNodeFormField(condition);
		} catch (Exception e) {
			throw new ExceptionUtil(e.getMessage(),e.getCause());
		}
		return i;
	}
}
